package org.jeecg.modules.payment.enums;

/**
 * 设备类型 pc 电脑浏览器 mobile手机浏览器 qq手机QQ内浏览器 wechat微信内浏览器 alipay 支付宝客户端
 */
public enum CuDeviceTypeEnum {
    PC("pc", "电脑浏览器"),
    MOBILE("mobile", "手机浏览器"),
    QQ("qq", "QQ手机浏览器"),
    WECHAT("wechat", "微信内浏览器"),
    ALIPAY("alipay", "支付宝客户端");
    private String code;
    private String name;

    CuDeviceTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static CuDeviceTypeEnum fromCode(String code) {
        for (CuDeviceTypeEnum deviceTypeEnum : CuDeviceTypeEnum.values()) {
            if (deviceTypeEnum.getCode().equals(code)) {
                return deviceTypeEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
